<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title><fmt:message key="user.common.title.label"/></title>
<link href="../styles/layout.css" rel="stylesheet" type="text/css" />
<script src="<c:url value='/scripts/common.js'/>"></script>
<script src="<c:url value='/scripts/change_region.js'/>"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F4F4F4;
	font-size:12px;
}
 
-->

<!--  
a:link { text-decoration: none}  
a:active { text-decoration: none }  
a:visited { text-decoration: none }  
-->  
</style>
</head>

<body>  
<html:form action="/manage/userInfo.html?action=update" styleId="userInfoBean"  method="post" > 

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25" class="home-content-title">
    <img src="../images/passenger.gif" align="absmiddle"/>
     用户管理
    </td>
  </tr>
    <logic:messagesPresent>
		<tr id="messagesPresentTrId" style="display:;">
			<td valign="top" class="black12" height="20">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
					<tr>
						<td class="arror_bg">
							<span class="arror_title">
						     您的操作存在如下错误：<br></span>
						     <html:errors/>
					    </td>
				    </tr>
			    </table>
			</td>
		</tr>
  </logic:messagesPresent>
  <tr id="messageShowTrId" style="display:none;">
	<td valign="top" class="black12">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
	<td class="arror_bg">
	<span class="arror_title"> 
     您的操作存在如下错误：<br/>
     </span>
     <span id="warnSaveMsgSpanId" style="display:none">
      <li>保存失败，<c:out value="${errors}"/><br/>
     </span>
    </td>
    </tr>
    </table>
	</td>
	</tr>
  <tr>
    <td height="20" class="home-search-space">&nbsp;带*标志的选项为必填项。</td>
  </tr>
  <tr>
    <td valign="top"> 
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <html:hidden property="id"/>
        <html:hidden property="password"/>
        <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content">
					<input  type="button"  class="home-inputBtn" value="保存" onclick="javascript:save();">
					<input name="Submit3" type="button" class="home-inputBtn" onclick="document.forms[0].reset();" value="重写">
                    <input  type="button"  class="home-inputBtn" value="取消" onclick="window.close();"/>
				</td>
              </tr>
              <tr>
                <td align="center" valign="top">&nbsp;</td>
              </tr>
              <tr> 
                <td valign="top" class="home-edittable-space"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td><table width="100%" border="0" cellpadding="4" cellspacing="1" class="home-subtable-bgcolor">
                          <tr> 
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <font color="red">*</font><fmt:message key="user.common.name"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
                            <html:text property="enName" size="18" styleClass="home-table-inputbox"/>
                            </td>
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <fmt:message key="user.common.cnName"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
                            <html:text  property="cnName" styleClass="home-table-inputbox"/> 
                            </td>
                          </tr>
                          <tr> 
                            <td class="home-subtable-view-tdstyle-right">
                            <fmt:message key="user.common.email"/>：</td>
                            <td width="30%" class="home-subtable-view-tdstyle-left">
                            <html:text property="email" styleClass="home-table-inputbox" size="18"/>
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <font color="red">*</font><fmt:message key="user.common.department"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
	                            <input class="home-table-inputbox" type="text" name="deptName" id="selectedText" size="11" value="<c:out value="${userInfoBean.deptName}"/>" readonly/>
						    	<input name="Submit" type="button" class="home-inputBtn" onclick="MM_openBrWindow('../deptChoose.html','','width=200,height=400,status=yes')" value="选择" />
						    	<input type="hidden" name="deptId" id="selectedId" value="<c:out value="${userInfoBean.deptId}"/>"/>
					    	</td>
                          </tr>
                          
                          <%--tr>
							<td width="110" class="leftd"><fmt:message key="userForm.addressForm.country"/>：</td>
						    <td class="rightd">
												 <html:select property="country"  onchange="
														 change_region(window.document.forms[0].province ,
														 window.document.forms[0].country.options[selectedIndex].value );">
													<html:option value="">-- 所有国家 --</html:option>
													<script language="javascript">
					       								set_select_options( window.document.forms[0].country, country, "" ) ;
													</script>
												</html:select>
						    
						    </td>
						    <td width="110" class="leftd"><fmt:message key="userForm.addressForm.province"/>：</td>
						    <td class="rightd">
					                                <html:select property="province" onchange="change_region(window.document.forms[0].city ,
					                                		window.document.forms[0].province.options[selectedIndex].value );">
															<html:option value="">-- 所有州/省--</html:option>
													</html:select>
						    </td>
						 
						</tr--%>
						<tr> 
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <font color="red">*</font><fmt:message key="user.common.phone"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
                            <html:text property="phone" size="18" styleClass="home-table-inputbox"/>
                            </td>
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <font color="red">*</font><fmt:message key="user.common.msisdn"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
                            <html:text property="msisdn" styleClass="home-table-inputbox" maxlength="11" size="20"/>
                            </td>
                          </tr>
                          <%--tr>
  
						    <td><fmt:message key="userForm.addressForm.city"/>：</td>
						    <td class="rightd">   <html:select property="city">
															<html:option value="">-- 城市 --</html:option>
														  </html:select></td>
						  	
						 </tr--%>
						 <tr> 
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <fmt:message key="user.common.addr"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
                            <html:text property="addr" size="30" styleClass="home-table-inputbox"/>
                            </td>
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <fmt:message key="userForm.addressForm.postalCode"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
                            <html:text property="postalCode" styleClass="home-table-inputbox" maxlength="6"/>
                            </td>
                          </tr>
                          <tr> 
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <fmt:message key="user.common.isUsable"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
                            <c:if test="${userInfoBean.isUsable==0}">
								<input type="checkbox" name="isUsable" value='0' checked/>
					    	 </c:if> 
					    	 <c:if test="${userInfoBean.isUsable==-1 || userInfoBean.isUsable==1}">
								<input type="checkbox" name="isUsable" value='1'/>	
					    	 </c:if>  
                            </td>
                            <td width="20%" class="home-subtable-view-tdstyle-right">
                            <fmt:message key="user.common.memo"/>：</td>
                            <td class="home-subtable-view-tdstyle-left">
                            <html:text property="memo" styleClass="home-table-inputbox" maxlength="200"/>
                            </td>
                          </tr>
                        </table></td>
                    </tr>
                  </table> 
                  
                </td>
              </tr>
            </table>
		  </td>
        </tr>
        <tr> 
          <td height="12">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table>
	  
	  </td>
  </tr>
  <tr>
    <td height="10">&nbsp;</td>
  </tr>
</table>
<html:hidden property="aryId"/> 
<html:hidden property="seledId"/>  
</html:form>
<script>
	function checkEmail(obj){ 
	if(obj.value=="") return;
    var myReg = /^([-_A-Za-z0-9\.]+)@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;    
    if(myReg.test( obj.value )) return true;    
    alert("请输入合法的电子邮件地址");   
    obj.value="";
    return false;    
}  
function f_check_mobile(obj){   
    if(obj.value=="") return;
	var myReg = /(^[1][3][0-9]{9}$)|(^0[1][3][0-9]{9}$)/;    
    if(myReg.test( obj.value )) return true;     
    alert("请输入正确的手机号码");   
    obj.value="";
    return false;      
}   

</script>
<script>
	function delCheck(){
		var ary = parent.frames["rightdownFrame"].submitData(); 
		document.forms[0].aryId.value = ary; 
		formSubmit(document.forms[0],"./userDelete.shtml?action=delete");
		winSkip("./userList.shtml?action=userList","rightdownFrame");
		 
 	}
 	
 	function selected(_form,_url){
		var ary = parent.frames["rightdownFrame"].submitData(); 
		document.forms[0].seledId.value = ary; 
		if(ary.length>1){
		 	alert("plese selected again,can't select multi-box");
		 }else{
		 	formSubmit(_form,_url);
		 }
 	}
 	
 	function save(){
 		//if(document.forms[0].deptName.value==""){
			//alert("部门名称不能为空!");	
 		//}else
 		 document.forms[0].submit();
 		/*else if(document.forms[0].password.value == "" ||
 		document.forms[0].confirmPwd.value == ""){
 			alert("密码不能为空!");
 		}else if(document.forms[0].password.value == document.forms[0].confirmPwd.value){
	 		document.forms[0].submit();
 		}else {
 			alert("密码不一致，请重新输入!");
 			document.forms[0].password.value = "";
 			document.forms[0].confirmPwd.value = "";
 		}*/	
 		
 	}
</script> 
<script>
	var flag = "<c:out value="${flag}"/>";
	var errors = "<c:out value="${errors}"/>";
	
		if(null!=errors&&""!=errors) {
			//alert("保存信息失败!")
			//alert(errors);
			var messageShowTrId=document.getElementById("messageShowTrId");
 			var messagesPresentTrId=document.getElementById("messagesPresentTrId");
 			var warnSaveMsgSpanId=document.getElementById("warnSaveMsgSpanId");
 			
 			if(messageShowTrId!=null)
 			   messageShowTrId.style.display="";
 			if(warnSaveMsgSpanId!=null)
 			   warnSaveMsgSpanId.style.display="";
 			if(messagesPresentTrId!=null&&messagesPresentTrId.style.display=="")
 			   messagesPresentTrId.style.display="none";
		}else {
		  if(flag == "success") {
			//alert("保存信息成功!");
			refreshParent();
			window.close();
	      }
		
		}
</script> 
</body>
</html>
